package vfs.obj.association;


import vfs.except.VFSException;
import vfs.filter.VFSFilter;
import vfs.obj.entity.VFSNode;
import java.util.Iterator;

/**
 * VFSNodeToParent is an association manipulator capable of 
 * manipulating the "has parent" relationship between Nodes and other Nodes.
 * 
 * @author Matthew Eavenson <durandal@uga.edu>
 */
public interface VFSNodeToParent{

    /**
     * Returns an iterator over all nodes with a specified parent,
     * and filtered by a specified filter.
     * 
     * @param parent the parent of the requested nodes
     * @param filter a filter over the nodes with the specified parent
     * @return an iterator over any matching nodes
     */
    Iterator<VFSNode> getChildren(VFSNode parent, VFSFilter filter) throws VFSException;
    
    /**
     * Returns the parent node of a specified node.
     * 
     * @param node the node whose parent is requested
     * @return the parent of the specified node
     */
    VFSNode getParent(VFSNode node) throws VFSException;
    
    /**
     * Sets the parent of a specified node to another specified node.
     * 
     * @param node the node whose parent will be set
     * @param parent the parent to assign to the specified node
     */
    void setParent(VFSNode node, VFSNode parent) throws VFSException;
    
}
